/*********************
* Author:Dzlua
* QQ:505544956
* time:2016/08/07
*/
#ifndef __EDUI_ISURFACE_H__
#define __EDUI_ISURFACE_H__

#include "../core/Base.h"

EDUI_NAMESPACE_BEGIN

class EDUI_API ISurface
{
public:
    virtual void Release() = 0;
public:
    virtual bool Create(const char* file, const char* name = 0, int id = -1) = 0;
    virtual bool Create(void* mem, int size, const char* name, int id = -1, const char* type = 0) = 0;
    virtual bool CreateRGB(int width, int height, int depth,
                     Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask, const char* name, int id = -1) = 0;
    virtual bool CreateRGBFrom(void *pixels,
                         int width, int height, int depth, int pitch,
                         Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
                         Uint32 Amask, const char* name, int id = -1) = 0;
    virtual bool IsOK() = 0;
	virtual void Destroy() = 0;

    //surface number.
    virtual int GetNum() = 0;
    //for gif
    virtual Point GetOffset(int id) = 0;
    //for gif
    virtual int GetDelay(int id) = 0;

    virtual Size GetSize(int id = 0) = 0;
    virtual int Pitch(int id = 0) = 0;
    //read/write
    virtual void* Pixels(int id = 0) = 0;
    //read/write
    virtual void* UserData(int id = 0) = 0;

    virtual bool SetBlendMode(BlendMode mode, int id = 0) = 0;
	virtual BlendMode GetBlendMode(int id = 0) = 0;
    virtual bool SetColorMod(Uint8 r, Uint8 g, Uint8 b, int id = 0) = 0;
	virtual Color GetColorMod(int id = 0) =0;
    virtual bool SetAlphaMod(Uint8 alpha, int id = 0) = 0;
	virtual Uint8 GetAlphaMod(int id = 0) = 0;

    virtual bool SetClip(const Rect *rect, int id = 0) = 0;
	virtual Rect GetClip(int id = 0) = 0;

    virtual bool Lock(int id = 0) = 0;
	virtual void Unlock(int id = 0) = 0;
};

EDUI_NAMESPACE_END

#endif